/**
 * Copyright (c) 2024-2025 National Fundamental Software of China Co., Ltd.
 *
 * You should have find a copy of NFSChina License. If not, please contact us
 * by email <os_support@nfschina>
 *
**/

/*
    SPDX-FileCopyrightText: 1998 Luca Montecchiani <m.luca@usa.net>
    SPDX-License-Identifier: GPL-2.0-or-later

*/
#pragma once

#include <KCModule>
#include <QStackedWidget>
#include <com_nfs_hwclock.h>
#include <KConfigWatcher>


class Dtime;
class Timezone;

class KclockModule : public KCModule
{
    Q_OBJECT
public:
    explicit KclockModule(QWidget *parent, const QVariantList &);

    void save() override;
    void load() override;
Q_SIGNALS:
    void stackviewchanged(QString title);

public Q_SLOTS:
    void handleDBusSignal();

private:
    void kauthSave();
    void timedatedSave();
    void needSaveNtp();
    bool m_haveTimedated = false;
    bool timedatedRc = true;

    Dtime *dtime;
    Timezone *tzone;
    KConfigWatcher::Ptr m_configWatcher;

    QStackedWidget stack;
    com::nfs::HwClock *m_hwclock;

};
